Repository navigation
FIX-2346: conversations open at their end, with no scroll to watch - #4229
Conversation
Every app opened or switched to a conversation by scrolling visibly from the top down to the end. Each had its own scroll code, so the rule now lives once in @flow-state-dev/react as useFollowLatest: a feed that opens (mount, a resetKey change, or its first read filling it) lands at the end before paint; content arriving live while the reader is at the end glides; a reader who scrolled up is never pulled down. - DevTool stream view, Shift Manager (conversation + task session), the Teammates lab (conversation + session popup) and the Claude Code-style lab (main thread, thread view, task sheet) use it. Shift Manager's lib/follow.ts and the Teammates lab's stick-to-bottom.ts are gone; their tests move to the hook. - The ui registry's ScrollOnNewRequest (and the kitchen-sink copy) lands a first load or session switch instantly, before paint; only a request that follows one on screen scrolls smoothly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiHKUc1cT214v6KRkYo
|
The latest updates on your projects. Learn more about Vercel for GitHub. 3 Skipped Deployments
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
Second look + architecture passOverall: the approach is right. One hook in 1. A second scroll rule survives in
|
Mechanism check (advisory, never blocks)Rows from
|
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiHKUc1cT214v6KRkYo
#4198 dropped the README's inventory markers, so the lab's inventory test is red on main and on every PR. Markers restored and the table regenerated with node scripts/inventory.mjs --write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiHKUc1cT214v6KRkYo
|
Generated by Claude Code |
The README stats tables were removed on purpose; #4127 fixes main by dropping the lab's table check instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NczDiHKUc1cT214v6KRkYo
|
I've reverted the README inventory restore in e62cf54. The stats tables were removed on purpose, and #4127 fixes main by dropping the Claude Code-style lab's table check instead. Until #4127 merges, Generated by Claude Code |
Requested by Jake · project thread
Problem
In every app (DevTool, Shift Manager, the Claude Code-style lab, the Teammates lab), opening or switching to a conversation scrolled visibly from the top down to the end. Each app had its own scroll code, so the fix had nowhere single to land.
What changes
One rule, in one place:
useFollowLatestin@flow-state-dev/react.resetKeychange such as a session switch, or its first read filling an empty feed) lands at the end before paint, withbehavior: "instant". It stays "opening" until the frame after it first overflows, and any jump longer than one view is also instant (a load, not an arrival).smooth). This keeps FIX-2338's live behavior.atEnddrives "Jump to latest",follow()goes back, andstay()holds the feed before history loads above it.Apps moved onto it
lib/follow.tsis deleted and its tests moved to the hookresetKey: sessionId) and the session popup.lib/stick-to-bottom.tsis deletedresetKey: session.id, sending a line follows), thread view (resetKey: task.id) and the task sheet. Before, every count change scrolled the reader downui registry
conversation(with the kitchen-sink copy, kept byte-identical for registry-drift):ScrollOnNewRequestnow lands a first load or a session switch instantly, in a layout effect gated on the container being attached. Only a request that follows one already on screen scrolls smoothly.Docs: the
@flow-state-dev/reactREADME has auseFollowLatestsection, andapps/docscommon-components coversScrollOnNewRequest. Changeset: react, devtool and shift-manager, patch. ui is private.Verification
Regression tests, each with a control run against main's source files swapped back in:
packages/devtool/test/stream-view-scroll.test.tsx: history lands at the end instantly, a live request glides, and a reader who scrolled up stays put. Both fail on main.labs/teammates/test/screen.test.tsx: opens and switches workers at the end instantly, and the popup opens at its latest step and then glides. Both fail on main. The existing streamed-follow test now lays the feed out, so it still proves the smooth follow.labs/claude-code-style/test/screen.test.tsx: a session opens at the end instantly and a reader scrolled up isn't pulled down, and the sheet opens at the end. Both fail on main.packages/ui/test/render/conversation-scroll.test.tsx: 3/3 fail on main (all smooth).packages/react/test/useFollowLatest.test.ts: the moved follow tests plus open, first-read, switch, live-glide and scrolled-up cases.The test suites pass for react (423), devtool (456), ui (239) and teammates (64). Typecheck passes for all touched packages plus kitchen-sink, and package-boundaries and test-typecheck validation pass. Two failures are not from this PR:
inventory.test.ts(README has no inventory block): it also fails onorigin/main.command.test.tsneedsdist-clientto be built, and the pages aren't built in this environment.Not yet checked: how it feels in a real browser. happy-dom lays nothing out, so the tests size the feeds by hand.
Generated by Claude Code